home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-08-23 | 25.7 KB | 597 lines | [TEXT/MPS ] |
- ################################# FILE HEADER #################################
- # © Apple Computer, 1985-1990
- #
- # FILE: RunLoop
- # AUTHORS: Cindy Roberts Apple International Software Support
- # Peter Potrebic(?) Apple Product Development
- # Dave McGary Apple International Software Support
- # CREATED: ?/??/88?
- # PURPOSE: Automated localization of revised Macintosh software.
- # DESCR.: This script uses 3 files to perform the localization.
- # The 3 files are derezed from 3 versions of the same application.
- # The 3 versions are: an old US (non-localized) version; a new US
- # (non-localized) version; and an old localized version.
- # The base names of the 3 files are passed to this script in
- # the MPW script variables OldUS OldLoc and NewUS. The script
- # appends “.r” to the script variable and opens the file.
- # All changes are made to the {NewUS}.r file.
- #
- ################################ REVISION HISTORY #############################
- #
- # July 30 made STR# go to the beginning of NewUS after each string list
- # July 30 found a better way to search for the number of the STR#'s
- # Oct 10 fixed problem with UserItems in DITLs
- # Oct 13 fixed problem with empty strings in STR# resources
- #
- # Mar 11, 1988 added ability to compare MENU, CNTL resources;
- # now compares box sizes instead of copying them automatically
- # March 11 Cindy tiles windows so you can see all of them at one time;
- # at end it stacks them
- # March 18 made aliases so program wouldn't be sooooo confusing!
- # March 18 compared all box sizes before copying them over
- # March 24 added ability to compare TEXT, WIND resources
- # March 29 fixed problem with UserItems in DITLs (skipped too far in
- # one of the files)
- # March 29 will copy now even if the attributes of the resource are
- # different in the files
- # March 29 fixed problem with negative resource numbers
- #
- # April 25 fixed problem with finding matching resource numbers when
- # number of digits differ
- # May 2 fixed problem with single digit DITL resource numbers
- # fixed problem if the number if items in DITL,MENU or STR#
- # don't match in OldUS and OldLoc
- # 1/26/90 ddm Added the file header, cleaned up the revision notes,
- # changed font, added strategy comments below.
- # 1/29/90 ddm Added MPW “variables” (constants) Success and Failure to
- # make the code easier to follow.
- # 1/30/90 ddm Rewrote all of the loops to key off of NewUS so that
- # new resources can be reported in the new Log file!
- # Added a mark for every major loop.
- # 1/31/90 ddm Added code to create and send entries to said log file.
- # 2/1/90 ddm Debugged new code log code and modifications to allow
- # using NewUS as the key file.
- # Fixed a bug which prevented localization of WINDow names.
- # 2/2/90 ddm Standardized capitalization of NewUS, OldUS and OldLoc.
- # Changed §!1:§!2 (finds 2 characters) to §!1:§!1 (finds
- # one character) in .... loop when verifying that the next
- # character is a comma. Removed comments (some mine, some
- # not) about fears of possible problems which were unfounded.
- #
- #
- #
- # Dave's notes (from here 'till the code starts):
- #
- # We need to consider the following conditions for any one resource:
- # 1) All files contain the resource
- # 2) The resource is new (in NewUS, not in OldUS)
- # 3) The resource was removed (in OldUS, not in NewUS)
- #
- # Note: I am assuming that any resource in OldUS is in OldLoc.
- # I realize this may not always be true, and I should allow for it.
- # (an example of this problem is the removal of the 'lctb' resource
- # in the Japanese localization of HyperCard)
- #
- # Cindy's script allows for conditions 1 & 2 only. In case of condition 2,
- # Cindy's code does nothing. I am adding code today (1/26/90) to log these
- # failures (condition #2) to a new (text format) log file.
- #
- # What can happen to a resource during localization?
- # the resource is used unchanged
- # the resource is localized
- # the resource is removed for localization
- # the resource is added for localization
- #
- # A word of caution about the confusing, convoluded code at the start of
- # each search for a new resource. The code looks something like this:
- #
- # find /∂'ALRT∂'/ "{OldLoc}.r"
- # break if {status} == {Failure}
- # find {id.num} "{OldLoc}.r"
- # find /∂'ALRT∂' ∂(`catenate "{OldLoc}.r".§`[,)]+/ "{NewUS}.r"
- #
- # The problems which make this necessary (a single find should be able
- # to match the string found by the first 3 lines) revolve around the single
- # quote character (') used to denote the type of a resource in a rez file.
- # This character has special meaning in MPW scripts and in regular
- # expresions. The unsurmountable problems involve regular expresions
- # (you can't select text with 's in it and then do a find of §; you get
- # illegal expression errors, because the 's are treated special).
- #
- # There is a simple solution: replace the ' character before the searches
- # are performed. This can be done only if the character you are going
- # to replace the 's with is not contained in the file when you start
- # (this guarentees that the reverse of the substitution will work
- # correctly). This would require a very simple tool to be written
- # before it would work reliably. The tool would have to select the
- # next character to search for, and would have to set the status to 2
- # to stop the process when it gets to the last possible character.
- #
- #
-
- if `Exists "{localization}"` # if the localization directory exists,
- set Log "{localization}LocalizationLog" # put the log file there
- else # otherwise
- set Log "{mpw}LocalizationLog" # put the log file in the MPW folder
- end # end {of if}
-
- echo RunLoop -- version 2/1/90 > "{Log}"
- echo RunLoop -- starting `date` >> "{Log}"
- echo "File {NewUS}.r" >> "{Log}"
- echo "The following resources should be localized:" >> "{Log}"
-
- set Success 0 #
- set Failure 2 #
- set id.num /([-])*([0-9])+/ #
- set box /∂{/:/∂}/ #
- #
- set string Δ/[ ∂t∂n]∂"≈∂"/!2:Δ/∂"[ ∂t∂n]*[;},∂/][ ∂t∂n;,]+[∂/}rn]/
-
- open "{NewUS}.r" #
- open "{OldUS}.r" #
- open "{OldLoc}.r" #
- open "{log}"
-
- #tilewindows # set up the windows for action.
- SizeWindow 500 100 "{NewUS}.r"
- SizeWindow 500 100 "{OldUS}.r"
- SizeWindow 500 100 "{OldLoc}.r"
- SizeWindow 500 100 "{Log}"
-
- MoveWindow 3 0 "{NewUS}.r"
- MoveWindow 3 85 "{OldUS}.r"
- MoveWindow 3 170 "{OldLoc}.r"
- MoveWindow 3 255 "{Log}"
-
-
- find • "{NewUS}.r" # go to beginning of file
- find • "{OldLoc}.r" # go to beginning of file
- find • "{OldUS}.r" # go to beginning of file
- #
- #
- #
- Loop
- find /∂'ALRT∂'/ "{NewUS}.r" # Find next ALRT rsrc in NewUS
- break if {status} == {Failure} # If not found, we are done.
- find {id.num} "{NewUS}.r" # get ID number of the ALRT
- set Number `catenate "{NewUS}.r".§` # Save the resource number for use later
- # Find matching rsrc in OldLoc
- find /∂'ALRT∂' ∂({Number}[,)]+/ "{OldLoc}.r"
- # Find matching rsrc in OldUS
- find /∂'ALRT∂' ∂({Number}[,)]+/ "{OldUS}.r"
- if {status} == {Success} # if found, I can localize it!
- find /∂{/ "{NewUS}.r" # find open curly bracket in NewUS
- find /∂{/ "{OldLoc}.r" # find open curly bracket in OldLoc
- find /∂{/ "{OldUS}.r" # find open curly bracket in OldUS
- find {box} "{NewUS}.r" # find the box coordinates in NewUS
- find {box} "{OldUS}.r" # find the box coordinates in OldUS
- # compare the old & new US boxes
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} # If they are equal
- copy {box} "{OldLoc}.r" # then cut and paste box size
- paste § "{NewUS}.r" # from OldLoc to NewUS
- else # else (the rectangle coordinates changed)
- # find {box} "{OldLoc}.r" # find the box coordinates in OldLoc
- # Log the box change!
- echo "*** Rectangle change — ∂'ALRT∂' {Number}" >> "{Log}"
- end #
- else # else (new ALRT!)
- # Log the new resource!
- echo "*** New resource — ∂'ALRT∂' {Number}" >> "{Log}"
- end #
- find • "{OldLoc}.r" # go to beginning of file
- find • "{OldUS}.r" # go to beginning of file
- End # End of the loop, on to the next resource type
- find • "{NewUS}.r" # go to beginning of file
- #
- #
- Loop
- find /∂'CNTL∂'/ "{NewUS}.r" # find the next CNTL resource
- break if {status} == {Failure} # exit this loop if there are no CNTLs in NewUS
- find {id.num} "{NewUS}.r" # find ID number of the CNTL
- set Number `catenate "{NewUS}.r".§` # Save the resource number for use later
- # Find the same CNTL in OldLoc
- find /∂'CNTL∂' ∂({Number}[,)]+/ "{OldLoc}.r"
- # Find the same CNTL in OldUS
- find /∂'CNTL∂' ∂({Number}[,)]+/ "{OldUS}.r"
- if {status} == {Success} # if found, check the box coordinates
- find {box} "{NewUS}.r" # get box coordinates from NewUS
- find {box} "{OldUS}.r" # get box coordinates from OldUS
- # Compare OldUS to NewUS
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} # If they are equal,
- copy {box} "{OldLoc}.r" # then cut and paste box size
- paste § "{NewUS}.r" # from OldLoc to NewUS
- else # else the box coordinates changed!
- # find {box} "{OldLoc}.r" # find box coordinates in OldLoc
- # Log the box change!
- echo "*** Rectangle change — ∂'CNTL∂' {Number}" >> "{Log}"
- end # end (of if)
- find {string} "{NewUS}.r" # Find the name of the control in NewUS
- find {string} "{OldUS}.r" # Find the name of the control in OldUS
- # Check to see if the name has changed
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} # If the strings match!
- find {string} "{OldLoc}.r" # then copy and paste the name
- # from OldLoc to NewUS
- catenate "{OldLoc}.r".§ > "{NewUS}.r".§
- else
- # Log the change!
- echo "*** Name change — ∂'CNTL∂' {Number}" >> "{Log}"
- end # end (of if strings match)
- else # New CNTL resource!
- # Log the change!
- echo "*** New resource — ∂'CNTL∂' {Number}" >> "{Log}"
- end # end (of if CNTL found)
- find • "{OldLoc}.r" # go to beginning of OldLoc file
- find • "{OldUS}.r" # go to beginning of OldUS file
- End # # end of CNTL loop
- find • "{NewUS}.r" # go to beginning of NewUS file
- #
- #
- Loop # Start of DITL loop
- find /∂'DITL∂'/ "{NewUS}.r" #
- break if {status} == {Failure} # end of all DITL's
- find {id.num} "{NewUS}.r" # find its id number
- set Number `catenate "{NewUS}.r".§` # Save the resource number for use later
- #
- find /∂'DITL∂' ∂({Number}[,)]+/ "{OldLoc}.r"
- #
- find /∂'DITL∂' ∂({Number}[,)]+/ "{OldUS}.r"
- if {status} == {Success} # if
- find /∂// "{NewUS}.r" # skip over number of items comment
- Loop #
- # get the item number from NewUS
- find /∂/∂* ∂[/!0:/∂] ∂*∂//¡0 "{NewUS}.r"
- break if {status} == {Failure} # stop if we run out of items to localize
- # Save the item number for use later
- set ItemNumber `catenate "{NewUS}.r".§`
- # look for the item in OldLoc
- find /∂/∂* ∂[{ItemNumber}∂] ∂*∂// "{OldLoc}.r"
- # look for the item in NewUS
- find /∂/∂* ∂[{ItemNumber}∂] ∂*∂// "{OldUS}.r"
- if {status} == {Failure} # there are more items in new file than in old file
- # Log the change!
- echo "*** New item(s) in — ∂'DITL∂' {Number}" >> "{Log}"
- break
- end
- find {box} "{NewUS}.r" #
- find {box} "{OldUS}.r" #
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} #
- copy {box} "{OldLoc}.r" # cut and paste box size
- paste § "{NewUS}.r" #
- else # #
- find {box} "{OldLoc}.r" #(necessary?)
- # Log the change!
- echo "*** Size/location change — ∂'DITL∂' {Number} item {ItemNumber}" >> "{Log}"
- end # #
- find {box} "{NewUS}.r" #
- find §¡1:§¡4 "{NewUS}.r" #
- #
- if `catenate "{NewUS}.r".§` == "Item"
- find /∂{/:/∂}/ "{NewUS}.r" #
- find /∂}/ "{NewUS}.r" #
- find §Δ:§!1 "{NewUS}.r" # finds next char after string
- # break if UserItem is last string in list
- break if `catenate "{NewUS}.r".§` ≠ ","
- find /∂{/:/∂}/ "{OldLoc}.r" # if user item then skip to next string (string?)
- find /∂{/:/∂}/ "{OldUS}.r" #
- else #
- find /∂{/:/∂}/ "{NewUS}.r" # find the string
- find /∂{/:/∂}/ "{OldUS}.r" #
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} #
- copy /∂{/:/∂}/ "{OldLoc}.r" # cut and paste text or icon info
- paste § "{NewUS}.r" #
- else #
- # find /∂{/:/∂}/ "{OldLoc}.r" #
- # Log the change!
- echo "*** Item change (text, name, etc) — ∂'DITL∂' {Number} item {ItemNumber}" >> "{Log}"
- end # need to check to see if character after selection in old US is comma--tests for end of this DITL
- find §Δ:§!1 "{NewUS}.r" #
- # Standard exit...
- break if `catenate "{NewUS}.r".§` ≠ ","
- find §Δ:§!1 "{OldUS}.r" #
- if `catenate "{OldUS}.r".§` ≠ ","
- # Log the change!
- echo "*** New item(s) in — ∂'DITL∂' {Number} after item {ItemNumber}" >> "{Log}"
- break
- end
- end # end of else
- end # end of loop
- else # else (new DITL!)
- # Log the new resource!
- echo "*** New resource — ∂'DITL∂' {Number}" >> "{Log}"
- end # end of status equal to zero test
- find • "{OldLoc}.r" #
- find • "{OldUS}.r" # go to beginning of file
- End #
- find • "{NewUS}.r" #
- #
- #
- Loop
- find /∂'DLOG∂'/ "{NewUS}.r" # find the next DLOG resource
- break if {status} == {Failure} #
- find {id.num} "{NewUS}.r" # find its id number
- set Number `catenate "{NewUS}.r".§` # Save the resource number for use later
- #
- find /∂'DLOG∂' ∂({Number}[,)]+/ "{OldLoc}.r"
- #
- find /∂'DLOG∂' ∂({Number}[,)]+/ "{OldUS}.r"
- if {status} == {Success} # if 0 I found it
- find /∂{/ "{NewUS}.r" #
- find /∂{/ "{OldUS}.r" #
- find /∂{/ "{OldLoc}.r" #
- find {box} "{NewUS}.r" #
- find {box} "{OldUS}.r" #
- #
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} #
- copy {box} "{OldLoc}.r" # cut and paste box size
- paste § "{NewUS}.r" #
- else #
- # find {box} "{OldLoc}.r" #
- echo "*** Size/location change — ∂'DLOG∂' {Number}" >> "{Log}"
- end #
- find /∂"/:/∂"/ "{NewUS}.r" # find info in quotes
- # is info identical?
- find /∂"`catenate "{NewUS}.r".§`∂"/ "{OldUS}.r"
- if {status} == {Success} #
- find /∂"/:/∂"/ "{OldLoc}.r" #
- copy § "{OldLoc}.r" # if same, cut and paste info
- paste § "{NewUS}.r" #
- else
- # Log the new resource!
- echo "*** Text change — ∂'DLOG∂' {Number}" >> "{Log}"
- end #
- else # else (new DLOG!)
- # Log the new resource!
- echo "*** New resource — ∂'DLOG∂' {Number}" >> "{Log}"
- end #
- find • "{OldLoc}.r" # go to beginning of file
- find • "{OldUS}.r" #
- End #
- find • "{NewUS}.r" #
- #
- #
- Loop
- find /∂'MENU∂'/ "{NewUS}.r" # find the next MENU resource
- break if {status} == {Failure} # Stop if there are no more in NewUS.
- find {id.num} "{NewUS}.r" # find its id number
- set Number `catenate "{NewUS}.r".§` # Save the resource number for use later
- find /∂'MENU∂' ∂({Number}[,)]+/ "{OldLoc}.r" # Find the same menu resource in OldLoc
- find /∂'MENU∂' ∂({Number}[,)]+/ "{OldUS}.r" # Find the same menu resource in OldUS
- if {status} == {Success} # if I found a match, continue
- find /[0-9]+/:/∂,∂n∂t∂{/ "{NewUS}.r" # Get the entire item (5 pieces, 1 string)
- find /[0-9]+/:/∂,∂n∂t∂{/ "{OldUS}.r" # Get the same in OldUS
- # Check to see if the entire menu dude matches
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} #
- copy /[0-9]+/:/∂,∂n∂t∂{/ "{OldLoc}.r" # copy and paste menu name (?????)
- paste § "{NewUS}.r" #
- else #
- find /[0-9]+/:/∂,∂n∂t∂{/ "{OldLoc}.r" # sync-up with NewUS (required)
- # Log the change!
- echo "*** Menu name change — ∂'MENU∂' {Number}" >> "{Log}"
- end #
- find /[0-9]+/ "{OldLoc}.r" # get the menu item count
- if "`catenate "{OldLoc}.r".§`" != "0" # if it's ≠ 0, proceed.
- Loop #
- find /∂/∂* ∂[/!0:/∂] ∂*∂//¡0 "{OldLoc}.r" # copy and paste menu items
- set ItemNumber `catenate "{OldLoc}.r".§`
- #
- find /∂/∂* ∂[{ItemNumber}∂] ∂*∂// "{OldUS}.r"
- #
- find /∂/∂* ∂[{ItemNumber}∂] ∂*∂// "{NewUS}.r"
- find {string} "{OldUS}.r" #
- find {string} "{NewUS}.r" #
- #
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} #
- find {string} "{OldLoc}.r" # copy and paste menu item
- catenate "{OldLoc}.r".§ > "{NewUS}.r".§ #
- else #
- find {string} "{OldLoc}.r" #
- # Log the change!
- echo "*** Menu item change — ∂'MENU∂' {Number} item {ItemNumber}" >> "{Log}"
- end #
- find /∂n/ "{NewUS}.r" #
- find §:§¡1 "{NewUS}.r" #
- break if `catenate "{NewUS}.r".§` ≠ "," # break-out if NewUS is empty
- find /∂n/ "{OldUS}.r" #
- find §:§¡1 "{OldUS}.r" #
- if `catenate "{OldUS}.r".§` ≠ "," # if OldUS is empty, NewUS has more
- # Log the change!
- echo "*** New menu item — ∂'MENU∂' {Number} item {ItemNumber}" >> "{Log}"
- break
- end # end (if catenate...
- end # end (if # entries ≠ 0)
- end #
- else # No matching MENU in OldUS!
- # Log the new resource!
- echo "*** New resource — ∂'MENU∂' {Number}" >> "{Log}"
- end #
- find • "{OldLoc}.r" # go to beginning of file
- find • "{OldUS}.r" #
- End #
- find • "{NewUS}.r" #
- #
- #
- Loop #
- find /∂'STR ∂'/ "{NewUS}.r" # find the next STR resource
- break if {status} == {Failure} #
- find {id.num} "{NewUS}.r" # find its id number
- set Number `catenate "{NewUS}.r".§` # Save the resource number for use later
- #
- find /∂'STR ∂' ∂({Number}[,)]+/ "{OldLoc}.r"
- #
- find /∂'STR ∂' ∂({Number}[,)]+/ "{OldUS}.r"
- if {status} == {Success} # if same resource found in both NewUS & OldUS
- find /∂{/:/∂}/ "{NewUS}.r" #
- find /∂{/:/∂}/ "{OldUS}.r" #
- #
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} # String remains unchanged
- copy /∂{/:/∂}/ "{OldLoc}.r" # cut and paste text or icon info
- paste § "{NewUS}.r" #
- else # String has changed
- # find /∂{/:/∂}/ "{OldLoc}.r" #
- # Log the change!
- echo "*** Text change — ∂'STR ∂' {Number}" >> "{Log}"
- end #
- else # else (new STR !)
- # Log the new resource!
- echo "*** New resource — ∂'STR ∂' {Number}" >> "{Log}"
- end # if 0 I found it
- find • "{OldLoc}.r" # go to beginning of file
- find • "{OldUS}.r" #
- End #
- find • "{NewUS}.r" #
- #
- #
- Loop # STR# (string-list) loop
- find /∂'STR∂#∂'/ "{NewUS}.r" # find the next STR# resource
- break if {status} == {Failure} # end of all STR#'s
- find {id.num} "{NewUS}.r" # find its id number
- set Number `catenate "{NewUS}.r".§` # Save the resource number for use later
- #
- find /∂'STR∂#∂' ∂({Number}[,)]+/ "{OldLoc}.r"
- #
- find /∂'STR∂#∂' ∂({Number}[,)]+/ "{OldUS}.r"
- if {status} == {Success} # if matching string-lists are found
- find /∂/∂* /:/ ∂*∂// "{OldLoc}.r" #
- find /∂/∂* /:/ ∂*∂// "{OldUS}.r" #
- find /∂/∂* /:/ ∂*∂// "{NewUS}.r" #
- Loop # String loop (check each string in the list)
- #
- find /∂/∂* ∂[/!0:/∂] ∂*∂//¡0 "{NewUS}.r"
- #
- set ItemNumber `catenate "{NewUS}.r".§`
- # find next item
- # ddm- which may not be in this resource
- # ddm- so we have to check to see if
- # ddm- ItemNumber = 1
- find /∂/∂* ∂[{ItemNumber}∂] ∂*∂// "{OldLoc}.r"
- #
- find /∂/∂* ∂[{ItemNumber}∂] ∂*∂// "{OldUS}.r"
- if {status} == {Failure} #
- # Log the new string! (empty STR# in OldUS file?)
- echo "*** New string(s) in — ∂'STR#∂' {Number}" >> "{Log}"
- break # Exit the String Loop!
- end #
- find {string} "{OldUS}.r" #
- find {string} "{NewUS}.r" #
- find {string} "{OldLoc}.r" #
- #
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} # if text matches in NewUS and OldUS
- # copy and paste text or icon info
- catenate "{OldLoc}.r".§ > "{NewUS}.r".§
- else #
- # Log the new text!
- echo "*** New text in — ∂'STR#∂' {Number} item {ItemNumber}" >> "{Log}"
- end #
- find §!1:§!1 "{NewUS}.r" # check next character in NewUS for comma.
- # if not found, break
- break if `catenate "{NewUS}.r".§` ≠ ","
- find §!1:§!1 "{OldUS}.r" # check next character in OldUS for comma.
- # if not found, there is a new string
- if `catenate "{OldUS}.r".§` ≠ ","
- # Log the new string!
- echo "*** New string(s) in — ∂'STR#∂' {Number}" >> "{Log}"
- break # if not found, break
- end
- end #
- else # else (new STR#!)
- # Log the new resource!
- echo "*** New resource — ∂'STR#∂' {Number}" >> "{Log}"
- end #
- find • "{OldUS}.r" # go to beginning of file
- find • "{OldLoc}.r" # go to beginning of file
- End #
- find • "{NewUS}.r" #
- #
- #
- Loop #
- find /∂'TEXT∂'/ "{NewUS}.r" # find the next TEXT resource
- break if {status} == {Failure} #
- find {id.num} "{NewUS}.r" # find its id number
- set Number `catenate "{NewUS}.r".§` # Save the resource number for use later
- #
- find /∂'TEXT∂' ∂({Number}[,)]+/ "{OldLoc}.r"
- #
- find /∂'TEXT∂' ∂({Number}[,)]+/ "{OldUS}.r"
- if {status} == {Success} # if 0 I found it
- find {string} "{NewUS}.r" #
- find {string} "{OldUS}.r" #
- #
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} #
- copy {string} "{OldLoc}.r" # cut and paste text or icon info
- paste § "{NewUS}.r" #
- else #
- # find {string} "{OldLoc}.r" #
- # Log the changes!
- echo "*** Text changes detected — ∂'TEXT∂' {Number}" >> "{Log}"
- end #
- else # else (new TEXT!)
- # Log the new resource!
- echo "*** New resource — ∂'TEXT∂' {Number}" >> "{Log}"
- end #
- find • "{OldLoc}.r" # go to beginning of file
- find • "{OldUS}.r" #
- End #
- find • "{NewUS}.r" #
- #
- #
- Loop #
- find /∂'WIND∂'/ "{NewUS}.r" # find the next WIND resource
- break if {status} == {Failure} #
- find {id.num} "{NewUS}.r" # find its id number
- set Number `catenate "{NewUS}.r".§` # Save the resource number for use later
- #
- find /∂'WIND∂' ∂({Number}[,)]+/ "{OldLoc}.r"
- #
- find /∂'WIND∂' ∂({Number}[,)]+/ "{OldUS}.r"
- if {status} == {Success} # if I found it
- find {box} "{NewUS}.r" #
- find {box} "{OldUS}.r" #
- #
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} #
- copy {box} "{OldLoc}.r" # cut and paste box size
- paste § "{NewUS}.r" #
- else #
- # find {box} "{OldLoc}.r" #
- # Log the change!
- echo "*** New location/size — ∂'WIND∂' {Number}" >> "{Log}"
- end #
- find /∂"/:/∂"/ "{OldUS}.r" # ddm 2/1/90 changed {string} to /∂"/:/∂"/
- find /∂"/:/∂"/ "{NewUS}.r" # ddm 2/1/90 changed {string} to /∂"/:/∂"/
- #
- compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
- if {status} == {Success} #
- # ddm 2/1/90 changed {string} to /∂"/:/∂"/
- find /∂"/:/∂"/ "{OldLoc}.r" # copy and paste text info
- #
- catenate "{OldLoc}.r".§ > "{NewUS}.r".§
- else #
- # Log the change!
- echo "*** New window name — ∂'WIND∂' {Number}" >> "{Log}"
- end #
- else # else (new WIND!)
- # Log the new resource!
- echo "*** New resource — ∂'WIND∂' {Number}" >> "{Log}"
- end #
- find • "{OldLoc}.r" # go to beginning of file
- find • "{OldUS}.r" #
- End #
- find • "{NewUS}.r" #
- #
- #
- close "{OldLoc}.r" #
- close "{OldUS}.r" #
- # logout
- echo RunLoop -- ending `date` >> "{Log}"
-